﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using blackhouse.BlackApart.Data;

namespace blackhouse.BlackApart.Business.Opinions {
    public class DaOpinionToReservation : IOpinionToReservation {

        #region Fields

        private IOpinionsDataAccess dataAccess;
        private ImpOpinionToReservation instance;

        #endregion

        #region Properties

        public int ReservationId {
            get { return this.instance.ReservationId; }
            set { this.instance.ReservationId = value; }
        }
        public int OpinionId {
            get { return this.instance.OpinionId; }
            set { this.instance.OpinionId = value; }
        }

        #endregion

        #region Constructors

        public DaOpinionToReservation(IOpinionsDataAccess iOptionsDataAccess) {
            this.dataAccess = iOptionsDataAccess;
            this.instance = new ImpOpinionToReservation();
        }

        #endregion

        #region Methods

        public bool Save() {
            if (this.instance.Save()) {
                return this.dataAccess.AddOpinionToReservation(this.OpinionId, this.ReservationId);
            } else return false;
        }

        #endregion

    }
}
